<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:include page="/WEB-INF/jsp/include/head.jsp" />
<%@ page language="java" pageEncoding="utf-8" %>
<div class="container">
    <jsp:include page="/WEB-INF/jsp/include/member-top.jsp" />
    <div class="row" style="margin-top: 15px;">
        <div class="col-md-3">
            <jsp:include page="/WEB-INF/jsp/include/member-left.jsp" />
        </div>
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-heading">个人资料</div>
                <div class="panel-body">
                    <form class="form-horizontal" enctype="multipart/form-data" action="${pageContext.request.contextPath}/member/profile" method="post">
                        <div class="form-group">
                            <label for="userName" class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" disabled readonly id="userName" value="${userInfo.user}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="name" id="name" placeholder="请输入名称" value="${userInfo.name}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">性别</label>
                            <div class="col-sm-10">
                                <c:forEach var="sexItem" items="${sex}" varStatus="each">
                                <div class="radio-inline">
                                    <label>
                                        <input type="radio" name="sex" <c:if test="${each.index == userInfo.sex}">checked</c:if> value="${each.index}">
                                        ${sexItem}
                                    </label>
                                </div>
                                </c:forEach>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">头像</label>
                            <div class="col-sm-10">
                                <c:if test="${userInfo.avatar != null}">
                                    <img src="${userInfo.avatar}" class="img-circle" style="width:100px;height:100px;" />
                                </c:if>
                                <input type="file" name="avatar" id="exampleInputFile">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">技能</label>
                            <div class="col-sm-10">
                                <c:forEach var="skill" items="${skills}">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" name="skill[]" <c:if test="${fn:contains(userSkills,skill)}">checked</c:if> value="${skill}"> ${skill}
                                    </label>
                                </div>
                                </c:forEach>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-info">更新信息</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp" />
